package com.hzqy.web.ac.epg;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hzqy.service.epg.AcUserBillServiceBean;

import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
@Controller
@RequestMapping("/acUserBill")
public class UserBillAction {
	private static final Log LOG = LogFactory.getLog(UserBillAction.class);

	@Resource
    private AcUserBillServiceBean  serviceBean;

	/**
	 * 先调用接口存放session  在继续后续操作
	 * @param resp
	 * @param callback
	 */
    @RequestMapping("/marketingEPG")
  	public void  marketingEPG(HttpServletResponse resp, String callback) {
  		Map<String ,String> map = new HashMap<>();
  		LOG.debug("callback="+callback);
  		map.put("result","3");
		serviceBean.printlnOut(resp, callback, map);
  	}
    
    @RequestMapping("/marketingTest")
	public void  marketingTest(HttpServletResponse resp, String callback) {
		Map<String ,String> map = new HashMap<>();
		LOG.debug("callback="+callback);
		map.put("result","3");
		serviceBean.printlnOut(resp, callback, map);
	}

	/**
	 * @param userID 用户机顶盒账号
	 * @param activityId 唯一活动id
	 * @param type  kid少儿  mv电影电视剧
	 */
	@RequestMapping("/marketing")
	public void  marketing(HttpServletRequest request,HttpServletResponse response,String userID, int activityId, String  type, String callback) {
		Map<String ,String> map = serviceBean.requestUserResultMap(request,response,userID,activityId,type);
		serviceBean.printlnOut(response, callback, map);
	}
	
	@RequestMapping("/marketingHQ")
	@ResponseBody
	public Object  marketingHQ(HttpServletRequest request,HttpServletResponse response,String userID, int activityId, String  type) {
		return serviceBean.requestUserResultMap(request,response,userID,activityId,type);
	}
}